package com.sandau.b230111.b23011123.service;

import com.sandau.b230111.b23011123.mapper.EmployeeMapper;
import com.sandau.b230111.b23011123.model.Employee;
import com.sandau.b230111.b23011123.repository.EmployeeRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Example;
import org.springframework.stereotype.Component;

@Component
public class EmployeeService {
    @Autowired
    private EmployeeMapper employeeMapper;
    @Autowired
    private EmployeeRepository employeeRepository;
    public Object finAll(Employee employee)
    {
        return employeeRepository.findAll(Example.of(employee));
    }
    public void deleteById(String id)
    {
        employeeMapper.deleteById(id);
    }
    public void save(Employee s)
    {
        employeeMapper.save(s);
    }
    public Employee getReferenceById(String id)
    {
        return employeeMapper.getReferenceById(id);
    }

    public void update(Employee s) {
        employeeMapper.update(s);
    }
}
